<!DOCTYPE html>
<!-- 分店批发后台明细管理页面 -->
<html>
<head>
<meta charset="utf-8">
<title>分店批发后台明细管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/wholesale/font.css">
<link rel="stylesheet" href="../../res/css/wholesale/xadmin.css">
<link rel="stylesheet" href="../../res/layui/css/layui.css">
<script type="text/javascript"
	src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="../../res/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript" src="../../res/js/wholesale/xadmin.js"></script>
</head>
<body>
	<div class="demoTable" style="margin-top: 10px;">
		<div class="x-body">
			<table class="layui-table"
				lay-data="{url:'../../listenBranchSellDetail/findById.action', page:true, id:'idTest'}"
				lay-filter="demo">
				<thead>
					<tr>
						<th lay-data="{field:'bsdId', sort: true, align:'center'}">零售明细Id</th>
						<th lay-data="{field:'mtName', align:'center'}">乐器类型</th>
						<th lay-data="{field:'muName',align:'center'}">乐器名称</th>
						<th lay-data="{field:'muNumber', align:'center'}">乐器数量</th>
						<th lay-data="{field:'subtotal', align:'center'}">小计</th>
						<th lay-data="{field:'retailPrice', align:'center'}">零售价</th>
						<th lay-data="{field:'openTime', align:'center'}">操作时间</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		layui.use('table', function() {
			var table = layui.table;
			console.info(getParameter("id"))
			var id = getParameter("id");
			//监听表格复选框选择
			table.on('checkbox(demo)', function(obj) {
				console.log(obj)
			});
			
			
			//表单重载
			var $ = layui.$, active = {
				reload : function() {
					var demoReload = $('#demoReload');
					//执行重载    查询
					table.reload('idTest', {
						page : {
							curr : 1
						//重新从第 1 页开始
						},
						where : {
						 
								title : demoReload.val(),
								id: getParameter("id")
							 
						}
					});
				}
			};
			
			active['reload'] ? active['reload'].call(this) : '';
			
		});
		/**
		 * 从地址栏传值的代码
		 * @param param
		 * @returns
		 */
		function getParameter(param) {
			var query = window.location.search;
			var iLen = param.length;
			var iStart = query.indexOf(param);
			if (iStart == -1)
				return "";
			iStart += iLen + 1;
			var iEnd = query.indexOf("&", iStart);
			if (iEnd == -1)
				return query.substring(iStart);
			return query.substring(iStart, iEnd);
		}
	</script>
</body>
</html>